<?php

/**
 * Tags de tratamento do conteúdo para o sistema.
 * Fonte retirada do site do smarty <www.smarty.net>
 *
 * @author André Coura <andreccls@gmail.com>
 * @since 20/05/2012
 */
function text_get_template($tpl_name, & $tpl_source, & $smarty_obj) {
	if (1 == 1) {
		$tpl_source = $tpl_name;
		return true;
	} else {
		return false;
	}
}

function text_get_timestamp($tpl_name, & $tpl_timestamp, & $smarty_obj) {
	if (1 == 1) {
		$tpl_timestamp = time();
		return true;
	} else {
		return false;
	}
}

function text_get_secure($tpl_name, & $smarty_obj) {
	return true;
}

function text_get_trusted($tpl_name, & $smarty_obj) {
}


function getCombobox($params){
	$daoClass = "";
	$metodoDao = "";
	$value = "";
	$style = "";
	$class = "";
	$name = "";
	$id = "";
	$txtDefault = "Selecione...";

	extract($params);
	
	require_once(FWK_COMP."Combobox.class.php");

	$objCombo = new Combobox();
	
	$objCombo->setName($name);
	$objCombo->setStyle($style);
	$objCombo->setClass($class);
	$objCombo->setId($id==""?$name:$id);
	$objCombo->setTxtDefault($txtDefault);
	$objCombo->setDaoComp($daoClass);
	$objCombo->setMetodoDao($metodoDao);
	
	$objCombo->getComponente($value);

}

function getGrid($params){
	$daoClass = "";
	$metodoDao = "";
	$style = "";
	$class = "";
	$pagAtual = "0";
	$limit = "12";
	$param1 = "";
	$param2 = "";
	$param3 = "";
	$param4 = "";
	$filtro = false;
	$mantemParams = true;
	$camposFiltro = "[]";
	
	extract($params);
	
	require_once(FWK_COMP."Grid.class.php");

	$objGrid = new Grid();
	
	$objGrid->setStyle($style);
	$objGrid->setClass($class);
	$objGrid->setDaoComp($daoClass);
	$objGrid->setMetodoDao($metodoDao);
	$objGrid->setPagAtual($pagAtual);
	$objGrid->setLimit($limit);
	$objGrid->setParam1($param1);
	$objGrid->setParam2($param2);
	$objGrid->setParam3($param3);
	$objGrid->setParam4($param4);
	$objGrid->setFilter($filtro);
	$objGrid->setMantemParams($mantemParams);
	$camposFiltro = str_replace(array("[","]", " ", "+"), "", $camposFiltro);
	$objGrid->setCamposFiltro(explode(",", trim($camposFiltro)));
	$objGrid->getComponente();
}


function getEditor($params){
	$value = "";
	$style = "";
	$class = "";
	$name = "";
	$id = "";

	extract($params);
	
	require_once(FWK_COMP."Editor.class.php");

	$objEditor = new Editor();
	
	$objEditor->setName($name);
	$objEditor->setStyle($style);
	$objEditor->setClass($class);
	$objEditor->setId($id==""?$name:$id);
	
	$objEditor->getComponente($value);
}



function getMultBox($params){
	$daoClassOrigem = "";
	$daoClassDestino = "";
	$idTela = "";
	$style = "";
	$class = "";
	$name = "";
	$id = "";
	$value = "";
	extract($params);
	
	
	
	require_once(FWK_COMP."MultBox.class.php");

	$objMultBox = new MultBox();
	
	
	$objMultBox->setName($name==""?$id:$name);
	$objMultBox->setStyle($style);
	$objMultBox->setClass($class);
	$objMultBox->setId($id==""?$name:$id);
	
	$objMultBox->setDaoOrigem($daoClassOrigem);
	$objMultBox->setDaoDestino($daoClassDestino);
	
	$objMultBox->getComponente($value);
	
	
}

?>